# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=freeglut

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.8.1
pkgrel=2
pkgdesc="freeglut allows the user to create and manage windows containing OpenGL contexts (mingw32-w64)"
arch=('any')
url="http://freeglut.sourceforge.net/"
license=('MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
options=('strip' 'buildflags' '!libtool')
source=("http://downloads.sourceforge.net/freeglut/freeglut-${pkgver}.tar.gz")
md5sums=('918ffbddcffbac83c218bc52355b6d5a')

build() {
  rm -rf "${srcdir}/freeglut-${pkgver}/build-${MINGW_CHOST}"
  mkdir "${srcdir}/freeglut-${pkgver}/build-${MINGW_CHOST}"
  cd "${srcdir}/freeglut-${pkgver}/build-${MINGW_CHOST}"

  ../configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --without-x
  make
}

package() {
  cd "${srcdir}/freeglut-${pkgver}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install

  #rm "${pkgdir}/usr/i686-w64-mingw32/lib/libglut.a"
}

